// log.hpp

// Easy GUI Library
//
// Copyright (C) 2008 John Torjo (see http://torjo.com/contact/ for email)
//
// Permission to copy, use, sell and distribute this software is granted
// provided this copyright notice appears in all copies.
// Permission to modify the code and to distribute modified code is granted
// provided this copyright notice appears in all copies, and a notice
// that the code was modified is included with the copyright notice.
//
// This software is provided "as is" without express or implied warranty,
// and with no claim as to its suitability for any purpose.
//
// You can find the latest version of this library at http://www.torjo.com/egui/


#ifndef JT07022008_log_HPP_DEFINED
#define JT07022008_log_HPP_DEFINED

#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif


#include <sstream>
#include "egui/core/wnd.hpp"
#include <typeinfo>

namespace egui {

struct egui_stream : std::basic_ostringstream<char_> {
    egui_stream& ref() { return *this; }

    ~egui_stream() ;
};

string type_name(const std::type_info & info) ;
string type_name(const window_top & w) ;
string type_name(const ev::base & e) ;


#ifdef EGUI_LOG
#define LEGUI_ egui_stream().ref()
#else
#define LEGUI_ if ( true); else egui_stream().ref()
#endif

}

#endif

